import request from '@/utils/request'
import { exportMethod } from '@/utils/utils'
import * as proxy from '@/constants/proxy'


//科技转移转化平台
//新增数据
export function getAdd(data: any) {
    return request({
        url: proxy.CHECC_API_CMS + '/kjsl/sttransfer/add',
        method: 'post',
        data
    })
}

//修改数据
export function getUpdate(data: any) {
    return request({
        url: proxy.CHECC_API_CMS + '/kjsl/sttransfer/update',
        method: 'post',
        data
    })
}

//批量删除数据
export function getDelect(ids: any) {
    return request({
        url: proxy.CHECC_API_CMS + `/kjsl/sttransfer/${ids}`,
        method: 'delete',
    })
}

//导出
export function getExport(data: any,fileName) {
    const params = {
        method: 'post',
        url: proxy.CHECC_API_CMS + '/kjsl/sttransfer/export',
        data: data,
        fileName:fileName
    }
    return exportMethod(params)
}


// 列表数据
export function getList(data: any) {
    return request({
        url: proxy.CHECC_API_CMS + '/kjsl/sttransfer/list',
        method: 'post',
        data
    })
}

//获取详情
export function getDetail(id: any) {
    return request({
        url: proxy.CHECC_API_CMS + `/kjsl/sttransfer/getDetailById/${id}`,
        method: 'get',
    })
}


//锁定
export function getLock(id: any) {
    return request({
        url: proxy.CHECC_API_CMS + `/kjsl/sttransfer/lock/${id}`,
        method: 'get'
    })
}

//解锁
export function getUnlock(id: any) {
    return request({
        url: proxy.CHECC_API_CMS + `/kjsl/sttransfer/unlock/${id}`,
        method: 'get'
    })
}

//确认
export function getConfirm(id: any) {
    return request({
      url: proxy.CHECC_API_CMS + `/kjsl/sttransfer/confirm/${id}`,
      method: 'get'
    })
  }
